package com.liang.common.lang;

import com.alibaba.fastjson.JSON;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @name: OnlineUser
 * @author: 李昂
 * @date: 2020-12-14 20:30
 * @description：OnlineUser 在线用户类
 * @update: 2020-12-14 20:30
 */

@Data
@AllArgsConstructor
public class OnlineUser {
    private String userId;
    private String avator;
    private String username;
    private String remark;
    private String id;
    private String anonymous;
    private String onlineCount;
    private String type;

    public OnlineUser(String userId, String avator, String username, String remark, String id, String anonymous) {
        this.userId = userId;
        this.avator = avator;
        this.username = username;
        this.remark = remark;
        this.id = id;
        this.anonymous = anonymous;
    }

    public static String jsonStr(String userId, String avator, String username, String remark, String id, String anonymous, String onlineCount, String type) {
        return JSON.toJSONString(new OnlineUser(userId, avator, username, remark, id, anonymous, onlineCount, type));
    }
}
